﻿@using XStudio.XCRF.Web.Models.Enums
@using XStudio.XCRF.Data.Entities.BasicInfo
@model BasicInfo
@(Html.Telerik().Grid<BasicOtherMerge>().Name("BasicOtherMergeViewGrid").Footer(false)
.DataKeys(keys => keys.Add(o => o.ID))
.Columns(columns =>
{
    columns.ForeignKey(o => o.Diagnose, DiagnoseTypeInfo.SelectListItems, "Value", "Text")
        .Title("方案").EditorTemplateName("DiagnoseType");
    columns.Bound(o => o.DrugName).Title("所用药物通用名");
    columns.Bound(o => o.Dose).Title("日剂量");
    columns.BoundDate(o => o.StartTime).Title("开始时间").EditorTemplateName("Date");
    columns.BoundDate(o => o.EndTime).Title("结束时间").EditorTemplateName("Date");
    columns.Bound(o => o.Effect).Title("治疗效果");
    columns.Bound(o => o.Remark).Title("备注");
    columns.Command(commands =>
    {
        commands.Edit().ButtonType(GridButtonType.Text);
        commands.Delete().ButtonType(GridButtonType.Text);
    }).Title("操作");
})
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text))
.DataBinding(dataBinding =>
{
    dataBinding.Ajax()
        .Select<BasicInfoController>(c => c._BasicOtherMergeList(Model.ID))
        .Insert<BasicInfoController>(c => c._BasicOtherMergeAdd(null, Model.ID))
        .Update<BasicInfoController>(c => c._BasicOtherMergeEdit(null))
        .Delete<BasicInfoController>(c => c._BasicOtherMergeDelete(null));
})
.Editable(edit => edit.Mode(GridEditMode.InLine))
)